<template>
  <div class="win">
    <div class="pay_top_box">
      <img v-if="bjurl" :src="bjurl+'pay_success_logo.png'" mode="widthFix" />
      <p>支付成功</p>
      <p class="money">
        ￥
        <span>{{total_price}}</span>
      </p>
    </div>
    <div class="pay_bottom_box">
      <button class="see_order" @click="hr_myOrder">查看订单</button>
      <button class="hr_index" @click="hr_index">返回首页</button>
    </div>
    <div class="word">
      <p>汽美养护感谢您的支持与厚爱</p>
    </div>
    <i-toast id="toast" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      bjurl: "",
      total_price: 0
    };
  },
  methods: {
    // 跳转到我的订单页
    hr_myOrder() {
      wx.reLaunch({
        url: "../myOrder/main?current=" + 1
      });
    },
    // 跳转到首页
    hr_index() {
      wx.switchTab({
        url: "../index/main"
      });
    }
  },
  onLoad(e) {
    Object.assign(this.$data, this.$options.data());
    this.bjurl = this.$bjurl;
    this.total_price = e.total_price;
  }
};
</script>

<style lang="scss" scoped>
.win {
  background-color: #ffffff;
  position: relative;
  .pay_top_box {
    display: flex;
    padding-top: 10%;
    flex-direction: column;
    align-items: center;
    color: #4d4d4d;
    font-size: 36rpx;
    img {
      width: 164rpx;
      margin-bottom: 7%;
    }
    .money {
      margin-top: 10%;
      color: $red;
      line-height: 0.9;
      font-size: 36rpx;
      span {
        font-size: 60rpx;
      }
    }
  }
  .pay_bottom_box {
    flex: 1;
    padding-top: 10vh;
    box-sizing: border-box;
    button {
      margin: 0 auto 7%;
      width: 597rpx;
      height: 84rpx;
      background-color: $green;
      border-radius: 42rpx;
      font-size: 36rpx;
      letter-spacing: 6rpx;
      color: #ffffff;
      line-height: 84rpx;
    }
  }
  .word {
    width: 750rpx;
    position: absolute;
    bottom: 9%;
    color: #999999;
    font-size: 36rpx;
    p {
      text-align: center;
    }
  }
}
</style>
